import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    // mode:"history",
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/dashboard',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/Dashboard.vue'),
                    meta: { title: '系统首页' }
                },
                {
                    path: '/device_list',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/device/device_list.vue'),
                    meta: { title: '设备列表' }
                },
                {
                    path: '/tabs',
                    component: () => import(/* webpackChunkName: "tabs" */ '../components/page/Tabs.vue'),
                    meta: { title: 'tab选项卡' }
                },
                {
                    path: '/user_list',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/user/user_list.vue'),
                    meta: { title: '用户信息列表', permission: true }
                },
                {
                    path: '/user_modify',
                    component: () => import(/* webpackChunkName: "form" */ '../components/page/user/user_modify.vue'),
                    name:'用户信息更改',
                    meta: { title: '用户信息更改', permission: true }
                },
                {
                    path: '/detection_list',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/detection/detection_list.vue'),
                    meta: { title: '检测结果' }
                },
                {
                    path: '/detection_detail',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/detection/detection_detail'),
                    name:'检测详情',
                    meta: { title: '检测详情' }
                },


                {
                    // 图片上传组件
                    path: '/modify_userinfo',
                    component: () => import(/* webpackChunkName: "upload" */ '../components/page/modify_userinfo.vue'),
                    meta: { title: '用户信息' }
                },

                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: { title: '403' }
                },


            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },

        {
            path: '*',
            redirect: '/404'
        }
    ]
});
